home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hobby PC 12
/
Hobby PC 12.iso
/
assets
/
Asset Library
/
Forms
/
validate.txt
< prev
next >
Wrap
Text File
|
2001-04-09
|
1KB
|
41 lines
<SCRIPT LANGUAGE="JavaScript" ID="sqValidate"><!--
function validate(theForm)
{
var formTest = true;
if (checkName(theForm.fname) != true) {formTest = false};
if (checkName(theForm.initial) != true) {formTest = false};
if (checkName(theForm.lname) != true) {formTest = false};
if (checkAddress(theForm.addr) != true) {formTest = false};
if (theForm.country == "")
{
formTest = false;
}
if (theForm.country == "Canada")
{
if (checkPostalCode(theForm.pcode) != true) formTest = false;
if (checkUSPhone(theForm.phone) != true) formTest = false;
if (checkProvinceCode(theForm.state) != true) formTest = false;
}
if (theForm.country == "USA")
{
if (checkZIPCode(theForm.pcode) != true) formTest = false;
if (checkStateCode(theForm.state) != true) formTest = false;
if (checkUSPhone(theForm.phone) != true) formTest = false;
}
if (theForm.country == "Int")
{
if (checkInternationalPhone(theForm.phone) != true) formTest = false;
}
if (checkEmail(theForm.email) != true) {formTest = false};
if (checkURL(theForm.url) != true) {formTest = false};
if (checkDate(theForm.year, theForm.month, theForm.day, "birthday") != true) {formTest = false};
if (checkCreditCard(theForm.cctype,theForm.cc) != true) {formTest = false};
return (formTest);
}
// -->
</SCRIPT>